﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
namespace XDSoft.Web.TB_Brand
{
    public partial class Show : Page
    {
        public string strid = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                if (Request.Params["id"] != null && Request.Params["id"].Trim() != "")
                {
                    strid = Request.Params["id"];
                    int id = (Convert.ToInt32(strid));
                    ShowInfo(id);
                }
            }
        }

        private void ShowInfo(int id)
        {
            XDSoft.BLL.TB_Clients cBll = new XDSoft.BLL.TB_Clients();
            XDSoft.BLL.TB_Brand bll = new XDSoft.BLL.TB_Brand();
            XDSoft.Model.TB_Brand model = bll.GetModel(id);
            this.lblid.Text = model.id.ToString();
            if (!string.IsNullOrEmpty(model.icon))
            {
                string vPath = WebCommon.GetVPath(this.Page);
                this.imgIcon.Src = vPath + model.icon.Replace("Big", "Small").Replace(@"\", @"/");
                this.imgIcon.Style.Add("display", "");
                this.imgIcon.Style.Add("cursor", "hand");
                this.imgIcon.Style.Add("alt", "查看原图");
                this.imgIcon.Attributes.Add("onclick", "window.open('" + this.imgIcon.Src.Replace("Small", "Big") + "');");
            }
            else
                this.imgIcon.Style.Add("display", "none");

            XDSoft.BLL.TB_Options oBll = new XDSoft.BLL.TB_Options();

            this.lblregCode.Text = model.regCode;
            if (!string.IsNullOrEmpty(model.typeCode))
                this.lbltypeCode.Text = oBll.GetModel(Convert.ToInt32(model.typeCode)).name;
            this.lblapplyDate.Text = model.applyDate.ToString();
            this.lblapplyManName.Text = model.applyManName;
            this.lblapplyManAddress.Text = model.applyManAddress;
            this.lblapplyManEnName.Text = model.applyManEnName;
            this.lblapplyManEnAddress.Text = model.applyManEnAddress;
            this.lblspecialStartDate.Text = model.specialStartDate.ToString();
            this.lblspecialEndDate.Text = model.specialEndDate.ToString();
            if (!string.IsNullOrEmpty(model.brandType))
                this.lblbrandType.Text = oBll.GetModel(Convert.ToInt32(model.brandType)).name;
            this.lblclientService.Text = model.clientService;
            this.lblproductList.Text = model.productList;
            this.lblagentFee.Text = model.agentFee.ToString();
            this.lblnetApplyDate.Text = model.netApplyDate.ToString();
            this.lbldocSubmitDate.Text = model.docSubmitDate.ToString();
            this.lblassignDate.Text = model.assignDate.ToString();
            if (!string.IsNullOrEmpty(model.status))
                this.lblstatus.Text = oBll.GetModel(Convert.ToInt32(model.status)).name;
            if (model.client != null)
                this.lblClient.Text = cBll.GetModel(Convert.ToInt32(model.client)).clientName;
            this.lblmemo.Text = model.memo;
            this.lblserviceExpire.Text = model.serviceExpire.ToString();

        }


    }
}
